<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>

<style type="text/css">

	input,select{
		width:156px;
	}
</style>
<%
	String path = request.getContextPath();

%>
</head>
<body>
	path:<%=path %>
	<form action="<%=path %>/user/add">
		<div>用户姓名：<input name="name" /></div>
		<div>用户密码：<input name="password" /></div>
		<div>注册时间：<input name="rtime" /></div>
		<div>用户状态：
			<select name="status">
				<option value="0">无效</option>
				<option value="1">有效</option>
			</select>
		</div>
		<div><button type="submit">form表单提交</button></div>
		<div><button type="button" id="btn-ajax">ajax异步提交</button></div>
	</form>
	
	<script type="text/javascript" src="/zh-web/static/js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">
		$("#btn-ajax").on("click",function(){
			debugger;
			$.ajax({
				url:"/zh-web/user/add",
				data:{
					name:$("input[name='name']").val(),
					password:$("input[name='password']").val(),
					rtime:$("input[name='rtime']").val(),
					status:$("input[name='status']").val()
				},
				success:function(data){
					alert(data);
				}
				
			})
		})
	
	</script>
	
	
	
	
	
	
	
	
	
	
</body>
</html>